import request from '@/utils/request'

const product = {
  Directory: '/examdirectory/getExamDirectoryById',
  Type: '/classType/selectClassTypeByExamId',
  List: '/package/selectPackageList',
  Add: '/package/insertPackage',
  Edit: '/package/updatePackage',
  EditCopy: '/package/selectPackageInfo',
  Record: '/packageChangeRecord/selectPackageChangeRecordList',
  WarehouseStatus: '/package/updateActiveBatch',
  SetTime: '/package/updateOpenTimeBatch',
  Affiliation: '/package/getJiGouInfo',
  CourseList: '/courseServiceManage/selectCourseServiceList',
  LearnList: '/studyPackageManage/selectStudyPackageManageList',
  GoodsType: '/packagetype/getPackageTypeListByExamId',
  ViewAgree: '/package/selectRelationAgreementInfo',
  AgreeList: '/protocolManage/list',
  AppInfo: '/packageAppRelation/selectPackageAppRelationInfo',
  AppSave: '/packageAppRelation/editAppContentManage',
  GetApp: '/packageAppRelation/selectBelongingToApp',
  Upload: '/base/upload',
  GoodsArgee: '/package/relationAgreement'
}

/**
 * @param parameter
 * @returns {*}
 */

// 课程目录
export function directory (parameter) {
  return request({
    url: product.Directory,
    method: 'post',
    data: parameter
  })
}

// 课程类型
export function type (parameter) {
  return request({
    url: product.Type,
    method: 'post',
    data: parameter
  })
}

// 获取学习包列表
export function learnList (parameter) {
  return request({
    url: product.LearnList,
    method: 'post',
    data: parameter
  })
}

// 获取课程服务列表
export function courseList (parameter) {
  return request({
    url: product.CourseList,
    method: 'post',
    data: parameter
  })
}

// 获取商品列表
export function list (parameter) {
  return request({
    url: product.List,
    method: 'post',
    data: parameter
  })
}

// 添加商品
export function add (parameter) {
  return request({
    url: product.Add,
    method: 'post',
    data: parameter
  })
}

// 修改商品
export function edit (parameter) {
  return request({
    url: product.Edit,
    method: 'post',
    data: parameter
  })
}

// 编辑复制获取信息
export function editCopy (parameter) {
  return request({
    url: product.EditCopy,
    method: 'post',
    data: parameter
  })
}

// 变更记录
export function records (parameter) {
  return request({
    url: product.Record,
    method: 'post',
    data: parameter
  })
}

// 批量设置仓库状态
export function warehouseStatus (parameter) {
  return request({
    url: product.WarehouseStatus,
    method: 'post',
    data: parameter
  })
}

// 批量设置上架时间
export function setTime (parameter) {
  return request({
    url: product.SetTime,
    method: 'post',
    data: parameter
  })
}

// 获取所属机构
export function affiliation (parameter) {
  return request({
    url: product.Affiliation,
    method: 'post',
    data: parameter
  })
}

// 商品课程类型
export function goodsType (parameter) {
  return request({
    url: product.GoodsType,
    method: 'post',
    data: parameter
  })
}

// 查看关联协议信息
export function viewAgree (parameter) {
  return request({
    url: product.ViewAgree,
    method: 'post',
    data: parameter
  })
}

// 查看关联协议信息
export function agreeList (parameter) {
  return request({
    url: product.AgreeList,
    method: 'post',
    data: parameter
  })
}

// 获取app内容信息
export function appInfo (parameter) {
  return request({
    url: product.AppInfo,
    method: 'post',
    data: parameter
  })
}

// app内容提交
export function appSave (parameter) {
  return request({
    url: product.AppSave,
    method: 'post',
    data: parameter
  })
}

// 获取所属app
export function getApp (parameter) {
  return request({
    url: product.GetApp,
    method: 'post',
    data: parameter
  })
}

// 图片上传
export function upload (parameter) {
  return request({
    url: product.Upload,
    method: 'post',
    data: parameter
  })
}

// 关联协议
export function goodsArgee (parameter) {
  return request({
    url: product.GoodsArgee,
    method: 'post',
    data: parameter
  })
}
